<template>
	<view class="page">
		<view class="body">
			<uni-section title="网站标题" type="line">
				<input type="text" placeholder="请输入标题" class="input_css" v-model="name" />
			</uni-section>
			<uni-section title="商家默认费率" type="line">
				<input type="text" placeholder="请输入费率" class="input_css" v-model="rates" />
			</uni-section>
			<uni-section title="商家提现手续费" type="line">
				<input type="number" placeholder="请输入密码" class="input_css" v-model="premium" />
			</uni-section>
			<uni-section title="服务商默认费率" type="line">
				<input type="number" placeholder="请输入服务商默认费率" class="input_css" v-model="serve_rates" />
			</uni-section>
			<uni-section title="服务商提现手续费" type="line">
				<input type="number" placeholder="请输入服务商提现手续费" class="input_css" v-model="serve_premium" />
			</uni-section>
			<uni-section title="错误跳转" type="line">
				<input type="text" placeholder="请输入支付密码" class="input_css" v-model="err_url" />
			</uni-section>
		</view>
		<view class="btn_css">
			<view class="btn" @click="btn">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				rates: '',
				premium: '',
				serve_rates: '',
				serve_premium: '',
				err_url: ''
			}
		},
		onLoad(e) {
			if (e.type == "edit") {
				uni.setNavigationBarTitle({
					title: '编辑服务商'
				})
			}
		},
		methods: {
			// 新增商家
			btn() {
				const data = {
					name: this.name,
					rates: this.rates,
					premium: this.premium,
					serve_rates: this.serve_rates,
					serve_premium: this.serve_premium,
					err_url: this.err_url
				}
				console.log("新增商家", data);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		height: 100%;

		.body {
			.input_css {
				background-color: #f5f6f9;
				padding: 30rpx;
				border-radius: 15rpx;
			}
		}

		.btn_css {
			padding-top: 50px;
		}
	}
</style>